package easy;

import util.PrintUtils;

public class Solution_832 {

    public int[][] flipAndInvertImage(int[][] image) {
        for (int[] ints : image) {
            for (int i = 0, j = ints.length - 1; i <= j; i++, j--) {
                if (i == j) {
                    ints[i] = ints[i] ^ 1;
                    continue;
                }
                int c = ints[i];
                ints[i] = ints[j] ^ 1;
                ints[j] = c ^ 1;
            }
        }
        return image;
    }

    public static void main(String[] args) {
        Solution_832 model = new Solution_832();
        int[][] ints = model.flipAndInvertImage(new int[][]{{1, 1, 0}, {1, 0, 1}, {0, 0, 0}});
        for (int[] anInt : ints) {
            PrintUtils.arrayInt(anInt);
        }
    }
}
